<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRechargeOilcardOrderDetailTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('recharge_oilcard_order_detail', function (Blueprint $table) {
            $table->increments('id');
            $table->integer("uid")->default(0)->comment("用户ID");
            $table->integer("recharge_oilcard_order_id")->default(0)->comment("油卡充值订单ID");
            $table->string("order_children_sn",30)->default('')->comment("子订单号");
            $table->integer("recharge_amount")->default(0)->comment("充值金额（分）");
            $table->tinyInteger("current_month",2)->default(0)->comment("当前月份");
            $table->tinyInteger("months",2)->default(0)->comment("充值月份");
            $table->string("user_oilcard_no",30)->default('')->comment("油卡卡号");
            $table->tinyInteger("user_oilcard_type",1)->default(0)->comment("油卡类型 1中石化，2中石油");
            $table->string("user_oilcard_name",50)->default('')->comment("持卡人姓名");
            $table->string("user_oilcard_mobile",15)->default('')->comment("持卡人手机号");
            $table->tinyInteger("recharge_mode",1)->default(0)->comment("充值方式1自动2手动");
            $table->tinyInteger("result_status",1)->default(0)->comment("状态 1 待充值 2进行中 3部分成功 4 充值成功 5 充值失败 6退款");
            $table->dateTime("result_time")->default('')->comment("请求充值时间");
            $table->dateTime("recharge_time")->default('')->comment("充值时间");
            $table->tinyInteger("is_deleted",1)->default(0)->comment("是否删除 0否 1是");
            $table->dateTime("deleted_at")->default('')->comment("删除时间");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('recharge_oilcard_order_detail');
    }
}
